<?php
/***
`*入口文件
 *
 */

require('setup.php');

if(isset($_GET["act"])){
	$action = $_GET["act"];
}else{
	$action = "index";
}
$models = array("activity","special");
if($action){
	if(!in_array($action,$models)){
		$action = "index";
	}
}else{
  
	$action = "index";
}

switch($action){
	
	//获取首页文件
	case "index":
		//社会栏目
		$qq = form_file_content("qq");
		$sina = form_file_content("sina");
		$wangyi = form_file_content("163");
		$sohu = form_file_content("sohu");
		//推荐栏目
		$tuijian = array();
		$tuijian[]= form_file_content("qq",3,10);
		$tuijian[]= form_file_content("sina",3,10);
		$tuijian[]= form_file_content("163",3);
		$tuijian[]= form_file_content("sohu",2);
		//图片新闻栏目
		$photo_new = form_photo("pho_sina");
	
		//滚动新闻
		$gundong_new = form_photo("ifeng",true);
		//励志新闻
		$lizhi_new = form_file_content("lizhi",12);
		//社会奇闻
		$qiwen_new = form_file_content("qiwen",14);
		//法治聚焦
		$falv_new = form_file_content("falv",11);

		//输出变量
		$smarty->assign("qqnew",$qq);
		$smarty->assign("sinanew",$sina);
		$smarty->assign("wangyinew",$wangyi);
		$smarty->assign("sohunew",$sohu);
		$smarty->assign("tuijian",$tuijian);
		$smarty->assign("photo_new",$photo_new);
		$smarty->assign("gundong",$gundong_new);
		$smarty->assign("lizhi",$lizhi_new);
		$smarty->assign("qiwen",$qiwen_new);
		$smarty->assign("falv",$falv_new);
		break;
	
	case "activity":
		//活动页面
		//推荐栏目
		$tuijiana = array();
		$tuijiana[]= form_file_content("qq",3,10);
		$tuijiana[]= form_file_content("sina",3,10);
		$tuijiana[]= form_file_content("163",3,10);
		$tuijiana[]= form_file_content("sohu",2,10);

		//输出变量
		$smarty->assign("tuijiana",$tuijiana);
		break;
	case "special":
		break;
}
$smarty->display($action.'.html');






